<?php include 'login/Restrito.php'; ?>
<script type="text/javascript">
function caractereData(campoData){
    var data = campoData.value;
    if (data.length == 2){
        data = data + '/';
        document.forms[0].data.value = data;
			return true;              
    }
    if (data.length == 5){
        data = data + '/';
        document.forms[0].data.value = data;
        return true;
    }
	  
}
</script>
<script type="text/javascript" src="receita/ajax.js"></script>
<form method="post" action="receita/ReceitaCadastrar.php" >
             <br />
             <h3 align="center">Prescrever Receita médica</h3>
			  	<hr color="#0066FF" size="3px">
			    <br />
			 <div align="center" style="min-height: 350px; width:auto">
             <table width="700px" align="center">
              <tr >
              	<td align="right">Nome do paciente</td>
              	<td><input type="text" name="txtnome" id="txtnome"/> 
              	<input type="button" name="btnPesquisar" value="Pesquisar" onclick="getDados();"/></td>
              </tr>
              <tr>
              	<td align="right">Resultado</td>
              	<td><div id="Resultado"></div></td>
              </tr>
              <tr>
          		<td align="right">Médico</td>
          		<td><select name="medico" >
          			<option selected >Selecione...</option>
          			<?php
							require "banco/ConexaoBanco.php";
							$query = mysql_query("SELECT * FROM medico");
							while($lista = mysql_fetch_array($query)) { ?> 
							<option value="<?php echo $lista['id_medico']; ?>"><?php echo $lista['m_nome']; ?></option>
						<?php } mysql_close();?>
          		</select>
	          	</td>
	          </tr>
                  <tr>
                    <td align="right">Data</td>
                    <td><input name="data" type="text" id="datepicker"  /> </td>
                </tr>
                <tr>
                    <td align="right" valign="top">Prescrição Médica</td>
                    <td><textarea name="desc" rows="8" cols="61" style="resize:none;"></textarea></td>
                </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td ><input type="submit" value="Salvar" class="botao" name="enviar"/></td>
                </tr>
              </table>
              </div>
        </form> 